home *** CD-ROM | disk | FTP | other *** search
Wrap
; Install script for ADHelp 1.0 ; $VER: ADHelpInstallScript 1.0 (11.6.94) ;********* ; Strings ;********* (set #bad-kick (cat "You must be using Kickstart 2.04 or higher to install using this script!" )) (set #copy-main "\n\n\n\n\nInstall ADHelp main program?") (set #copy-main-help (cat "\nThis will install the ADHelp main program (recommended)." )) (set #install-msg (cat "Installation program for ADHelp V1.0\n" "The Autodoc&Include&more help utility for\n all editors with ARexx\n\n" "©1992-94 by Gerhard Müller. All rights reserved.\n\n" "(You have to install ADHelp in your Editor, too. Please look at the documentation!)\n" "\n\nADHelp is Shareware. Please register if you use ADHelp regulary!\n" )) (set #copy-rexx (cat "Do you want to use supplied Arexx-Scripts?\n" "(Scripts are available for EDGE, CygnusEd and GoldED)\n" )) (set #copy-rexx-help (cat "This will install the ARexx-scripts which are called\n" "from your editor. You can choose as many as you want. " "If your editor is not in this list, click on one entry," "modify it for your editor and send me your new arexx script" )) (set #generate-indexfile (cat "Do you want to generate an indexfile for ADHelp?\n" "(This is necessary if you have not already an indexfile," " it is also necessary if you want to add ADHelp to your" " user-startup)\n" "You have to enter an absolute path name!\n" "If you use GoldED, please look in the manual before you proceed!" )) (set #generate-indexfile-help (cat "This is recommended if you are using ADHelp the first time\n\n" "The indexfile will contain all information from your includes, " "autodocs etc.\n" )) (set #indexfile-autodoc (cat "Do you want to generate the indexfile from your autodocs?\n" "You have to enter an absolute path name!" )) (set #indexfile-autodoc-help (cat "This is recommended if you have Commodore's autodocs\n\n" "All autodoc files have to end with ".doc", otherwise they will be skipped. " "(This is useful if you have other files in your autodoc directory)\n" )) (set #indexfile-include (cat "Do you want to generate the indexfile from your C-includes?\n" "You have to enter an absolute path name!" )) (set #indexfile-include-help (cat "This is recommended if you have Commodore's C-include files. " "All include files have to end with \".h\" or \".hP\", otherwise they won't be recognized." )) (set #indexfile-include-asm (cat "Do you want to generate the indexfile from your Assembler-includes?\n" "You have to enter an absolute path name!" )) (set #indexfile-include-help-asm (cat "This is recommended if you have Commodore's Asm-include files. " "You can set a pattern as filename, like asm-inc:#?/#?.i etc. " "The default are all file, and all subdirectories are scanned." "(Do not press enter if you use wildcards)\n" )) (set #adduser (cat "Do you want to start ADHelp in your user-startup?\n" "(This is not really necessary, as you can put ADHelp in your WBStartup-Drawer as well)\n" )) (set #adduser-help (cat "This will start ADHelp every time you start your computer\n" "ADHelp uses some memory (without indexfile 50K), so it could be good to start it only if neccessary if you are short of memory. " "You can easy put ADHelp in your sys:WBStartup-drawer, just move ADHelp in it." )) (set #copy-GetOffsets (cat "Do you want to copy the files that generate the indexfile?\n" )) (set #copy-GetOffsets-help (cat "This is useful if you want to build your own indexfile " "(perhaps if you want to add a new autodoc-file to the indexfile later)\n" )) (set #install-documentation (cat "Do you want to install the supplied amigaguide-manual?\n" )) (set #install-documentation-help (cat "This is useful if you want to modify anything later, " "also useful tips & hints are given in the manual.\n" "You will also need the manual to install ADHelp in your editor.\n" )) (set #indexfile-sclib (cat "If you have the SAS/C compiler 6.5x, you can build an indexfile from your sc_lib.guide-file. " "With it you can look for functions like malloc(), variables like __stack etc. Do you want " "an indexfile generated from your sc_lib.guide-file?\n" "You have to enter an absolute path name!" )) (set #indexfile-sclib-help (cat "You can only use this if you have the sc_lib.guide-file. The sc_lib-guide-file is not " "touched in any way. The help entries will have some AmigaGuide-strings in them." )) (set #indexfile-manpages (cat "If you have some manpages (perhaps you are using gcc), you can build an indexfile from these. " "With them you can look for functions like malloc(), etc. Do you want " "an indexfile generated from your manpages?\n" )) (set #indexfile-manpages-help (cat "You can only use this if you have some manpages. The manpages have to be in the same format " "as the manpages that come along with gcc. The manpages have to be converted if you want to " "use them, as some special chars for bold and unerlined have to be removed. You are asked " "if you want to convert your manpages" )) (set #convert-manpages (cat "If you want to use manpages, you have to remove some special chars from them. " "This can be done here. Do you want your manpages to be converted?\n" )) (set #convert-manpages-help (cat "If you do not convert your manpages, you won't be able to use them." )) (set #copy-manpages (cat "Do you want your man pages copied to somewhere else before " "they get converted? This is necessary if you like the bold and unerlined " "characters when using \"man\".\n" )) (set #copy-manpages-help (cat "Your manpages will get modified, so copy them if you are in doubt." )) ;******************************************* ; make sure Kick 2.0 or higher is available ;******************************************* (if (< (/ (getversion) 65536) 37) ( (abort #bad-kick) )) (message #install-msg) (welcome) ;***************** ; Install Program ;***************** ; main prg (set oldlevel @user-level) (if (= oldlevel 0) (user 1) ) (set adhelp-dir (askdir (prompt "Please select directory where to store ADHelp:\n(Please create a new drawer if wanted)\n" ) (help @askdir-help) (default (tackon @default-dest "ADHelp")) (newpath) ) ) (set @default-dest adhelp-dir) (user oldlevel) (if (askbool (prompt #copy-main) (help #copy-main-help) (default 1) ) ( (copyfiles (prompt "Installing ADHelp...") (source "ADHelp") (help #copy-main-help) (dest @default-dest) (infos) ) ) ) ; rexx-scripts (if (askbool (prompt #copy-rexx) (help #copy-rexx-help) (default 1) ) ( (set @default-destrexx (askdir (prompt "Please select a drawer for ADHelp-Arexx-Scripts:\n(Please create one if neccessary)" ) (help @askdir-help) (default (tackon @default-dest "rexx")) (newpath) ) ) (SET rexxs (ASKOPTIONS (PROMPT "Which editor(s) are you using?") (HELP "Here you define which Arexx-scripts to copy") (CHOICES "EDGE" "CygnusEd" "GoldEd"))) (SET n 0) (WHILE (SET file (SELECT n "rexx/ADHelp.edge" "rexx/ADHelp.ced" "rexx/ADHelp.ged" "" ) ) (IF (IN rexxs n) ( (IF (= n 2) (copyfiles (prompt "Copying ARexx-files...") (source "rexx/ADHelpAsk.ged") (help #copy-rexx-help) (dest @default-destrexx) ) ) (copyfiles (prompt "Copying ARexx-files...") (source file) (help #copy-rexx-help) (dest @default-destrexx) ) ) ) (SET n (+ n 1)) ) ) ) ; ask name of indexfile (if (askbool (prompt #generate-indexfile) (help #generate-indexfile-help) (default 1) ) ( (set indexfiledest (askfile (prompt "Please select name of indexfile:\nYou have to enter an absolute path name!") (help #generate-indexfile-help) (default (tackon @default-dest "ADHelp.index")) ) ) ; build indexfile autodocs ; (if ; (askbool ; (prompt #indexfile-autodoc) ; (help #indexfile-autodoc-help) ; (default 1) ; ) ( ; we HAVE to know the path to the autodocs (set oldlevel @user-level) (if (= oldlevel 0) (user 2) ) (set indexfiledocdir (askdir (prompt "Please select your directory with\n" "Commodore's autodoc-files:\n" ) (help #indexfile-autodoc-help) (default "AUTODOCS:") ) ) (user oldlevel) ; generate indexfile (working "\n\n\n\nPlease be patient... Working...") (RUN (CAT "GetAutodocOffsets " indexfiledocdir " >" indexfiledest ) ) ) ; ) ; build indexfile includes (set oldlevel @user-level) (if (= oldlevel 0) (user 1) ) (if (askbool (prompt "Do you program in C or Assembler?") (help "Here you can define which include files are scanned: the C or Assembler-includefiles") (choices " C " "Assembler") (default 1) ) ( ; we HAVE to know the path to the C-includes (set indexfileincdir (askdir (prompt "Please select your directory with " "your (and perhaps Commodore's) C-include-files:\n" ) (help #indexfile-include-help) (default "INCLUDE:") ) ) ; generate indexfile (working "\n\n\n\nPlease be patient... Working...") ; we create temporry file as GetIncludeStructsoffset needs more stack ; (RUN "echo >T:ADTempInstall Stack 20000") ; (RUN "echo >>T:ADTempInstall" (CAT "GetIncludeStructsOffsets " indexfileincdir " >>" indexfiledest) ) ; (Execute "T:ADTempInstall") ; (Delete "T:ADTempInstall") (RUN (CAT "GetIncludeStructsOffsets " indexfileincdir " >>" indexfiledest) ) ) ( ; we HAVE to know the path to the Asm-includes (set indexfileincdir (askdir (prompt "Please select your directory with\n" "Commodore's Assembler-include-files:\n" ) (help #indexfile-include-help-asm) (default "ASM-INCLUDE:") ) ) ; generate indexfile (working "\n\n\n\nPlease be patient... Working...") (RUN (CAT "GetAsmIncludeIndex " indexfileincdir " >>" indexfiledest) ) ) ) ; (set oldlevel @user-level) ; (if (= oldlevel 0) ; (user 1) ; ) (if (askbool (prompt #indexfile-sclib) (help #indexfile-sclib-help) (default 1) ) ( ; we HAVE to know the path to the guide file (set indexfilesclib (askfile (prompt "Please select your sc_lib.guide-file:\n" ) (help @indexfile-sclib-help) (default "sc:help/sc_lib.guide") ) ) ; generate indexfile (working "\n\n\n\nPlease be patient... Working...") (RUN (CAT "GetSCLibOffsets " indexfilesclib " >>" indexfiledest) ) ) ) (if (askbool (prompt #indexfile-manpages) (help #indexfile-manpages-help) (default 0) ) ( (set manpagesdest "") (set gotmanpagedir 0) (if (askbool (prompt #convert-manpages) (help #convert-manpages-help) (default 1) ) ( (if (askbool (prompt #copy-manpages) (help #copy-manpages-help) (default 1) ) ( ; copy manpages to other place (set manpagessource (askdir (prompt "Please select your manpages source directory:\n" ) (help #convert-manpages-help) (default "gcc:man") ) ) (set manpagesdest (askdir (prompt "Please select your manpages destination directory:\n(please create one if necessary)\n" ) (help #convert-manpages-help) (default "gcc:man2") ) ) (set gotmanpagedir 1) (copyfiles (prompt "copying man-pages...") (source manpagessource) (help #convert-manpages-help) (dest manpagesdest) (all) ) ) ) (if (= gotmanpagedir 0) (set manpagesdest (askdir (prompt "Please select your manpages directory:\n" ) (help #convert-manpages-help) (default "gcc:man2") ) ) ) ; convert manpages (working "\n\n\n\nPlease be patient... Converting manpages...") (RUN (CAT "RemoveAnsiFromManpages " manpagesdest) ) ) ) (if (= gotmanpagedir 0) (set manpagesdest (askdir (prompt "Please select your manpages directory:\n\n" ) (help #convert-manpages-help) (default "gcc:man2") ) ) ) ; generate indexfile (working "\n\n\n\nPlease be patient... Generating indexfile...") (RUN (CAT "GetManPagesOffsets " manpagesdest " >>" indexfiledest) ) ) ) (user oldlevel) ; ask for startup options (SET startup-opts (ASKOPTIONS (PROMPT "Here you can set some options on ADHelp start (please read the manual for full list of optins):\n") (HELP (CAT "Load indexfile only if neccessary\n\n(RELOAD) " "This is useful if you are short of memory and have a hard disk.\n" "The indexfile is loaded only if necessary. After each search operation " "the indexfile is flushed out of memory. Use this option only under " "OS 2.04 - 2.1, as unter V39 (OS3.0) and above a low memory handler is " "installed that flushes the indexfile automatically if the OS needs more memory.\n\n" "on unsuccessful search try again with *A added\n\n(ADD_A) " "If a search is unsuccessful, add *A to the search string and try again. " "This is useful as some entries are only with the added A in the autodoc " "files like CallHookA() etc.\n\n" "do case insensitive search\n\n(NOMINDCASE) Do case insensitive " "searches (default is case sensitive)\n\n" "can read XPK-packed help files\n\n(XPK) " "select this option if you are going to use xpk-packed autodoc, include " "or other help files. Please select this only if you are really use xpk-packed files, " "as this slows down ADHelp a little bit also with uncrunched help files.\n\n" "There are some more options available - please look in the documentation for them\n" ) ) (DEFAULT 0) (CHOICES "load indexfile only if neccessary" "on unsuccessful search try again with *A added" "do case insensitive searches" "can read XPK-packed help files" ))) (tooltype (dest (TACKON @default-dest "ADHelp")) (settooltype "DONOTWAIT" "") ) (tooltype (dest (TACKON @default-dest "ADHelp")) (settooltype "INDEXFILE" indexfiledest) ) (tooltype (dest (TACKON @default-dest "ADHelp")) (settooltype "CURRENTDIR" indexfiledocdir) ) (set clioptions " ") (SET n 0) (WHILE (SET s-opt (SELECT n "RELOAD" "ADD_A" "NOMINDCASE" "XPK" "" ) ) (IF (IN startup-opts n) ( (tooltype (dest (TACKON @default-dest "ADHelp")) (settooltype s-opt "") ) (set clioptions (cat clioptions " " s-opt)) ) ( ; put other tool types in brackets (tooltype (dest (TACKON @default-dest "ADHelp")) (settooltype (cat "(" s-opt ")") "") ) ) ) (SET n (+ n 1)) ) (tooltype (dest (TACKON @default-dest "ADHelp")) (settooltype "(PORTNAME=ADHELP)" "") ) (tooltype (dest (TACKON @default-dest "ADHelp")) (settooltype "(NONICEHELP=\", (){}|:<>\")" "") ) (tooltype (dest (TACKON @default-dest "ADHelp")) (settooltype "(WILDMINDNOCASE)" "") ) (tooltype (dest (TACKON @default-dest "ADHelp")) (settooltype "(NOMEMHANDLER)" "") ) (tooltype (dest (TACKON @default-dest "ADHelp")) (settooltype "(TEMPFILE=T:ADHelp.temp)" "") ) ; add line to user-startup (if (askbool (prompt #adduser) (help #adduser-help) (default 1) ) ( (STARTUP "ADHelp" (PROMPT "Sure to modify user-startup?") (HELP #adduser-help) (COMMAND (CAT "run >NIL: <NIL: " (TACKON @default-dest "ADHelp") " " indexfiledest " " clioptions) ) ) ) ) ) ) ; copy GetIncludeStr... etc. ? (if (askbool (prompt #copy-GetOffsets) (help #copy-GetOffsets-help) (default 1) ) ( (set getoffsdir (askdir (prompt "Please select a drawer for the commands\n" "that can build an indexfile\n" ) (help @askdir-help) (default @default-dest) (newpath) ) ) (copyfiles (prompt "copying files...") (source "GetAutodocOffsets") (help #copy-GetOffs-help) (dest getoffsdir) ) (copyfiles (prompt "copying files...") (source "GetIncludeStructsOffsets") (help #copy-GetOffs-help) (dest getoffsdir) ) (copyfiles (prompt "copying files...") (source "GetAsmIncludeIndex") (help #copy-GetOffs-help) (dest getoffsdir) ) (copyfiles (prompt "copying files...") (source "GetSCLibOffsets") (help #copy-GetOffs-help) (dest getoffsdir) ) (copyfiles (prompt "copying files...") (source "RemoveAnsiFromManpages") (help #copy-GetOffs-help) (dest getoffsdir) ) (copyfiles (prompt "copying files...") (source "GetManPagesOffsets") (help #copy-GetOffs-help) (dest getoffsdir) ) ) ) ; Install documentation ;*********************** ; Install Documentation ;*********************** (if (askbool (prompt #install-documentation) (help #install-documentation-help) (default 1) ) ( (set guidedest (askdir (prompt "Please select a drawer for ADHelp's\n" "AmigaGuide documentation:") (help @askdir-help) (default @default-dest) (newpath) ) ) (copyfiles (prompt "Installing Documentation...") (source "ADHelp.guide") (infos) (noposition) (help #copyguide-help) (dest guidedest) ) (if (>= (/ (getversion) 65536) 39) (tooltype (dest (tackon guidedest "ADHelp.guide")) (setdefaulttool "SYS:Utilities/MultiView") ) (tooltype (dest (tackon guidedest "ADHelp.guide")) (setdefaulttool "SYS:Utilities/AmigaGuide") ) ) ) ) ;*********************** ; Register ;*********************** (if (askbool (prompt "Do you want to register ADHelp immediately?\n\n(This will print the registration form to prt:, you can also fill in the registration form later and send it to me via email)") (help (CAT "Do me a favour and register ADHelp. It took many months of hard work to " "create this program of this level of perfection you see in front of you " "now. Read the file \"Registration_Form\" for further information. " "Additionally, if you register you get a keyfile which prevents the " "\"Shareware reminder\"-requester to pop up.\n\n" "ADHelp does not cost much. Please send me 15 DM (or US $10) if you want to " "get a keyfile via email. I know, email is not so save, but it is cheaper " "for you and me, as you don't have to pay for a disk and the postage. If " "you want your keyfile not via email, please add DM 5 or US $4, and I will " "send you your keyfile with ADHelp on a disk.\n" "\n" "Special prices are available for more than one keyfile:\n" "\n" " 3 keyfiles ........ 13DM (or $9) each\n" " 4 or 5 keyfiles ........ 11DM (or $8) each\n" " 10 (and more) keyfiles ........ 10DM (or $7) each\n" "\n" "If you want your keyfiles on disk, you of course only have to pay once for " "the disk and the postage." )) (default 0) ) ( (RUN "copy Registration_form to prt:" ) ) )